home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
science
/
sm32a.zip
/
LIBRARY
/
LSOLVE.LI2
< prev
next >
Wrap
Text File
|
1994-09-21
|
359b
|
8 lines
# psolve() is polynomial solver
# e.g. psolve(x^2+5*x+6, x) gives [-2, -3]
lsolve(eq1_, eq2_, x_, y_) := if(order(eq1,x) == 1 and order(eq1,y) ==1,
block(dd:=coef(eq1,x,1)*coef(eq2,y,1)-coef(eq1,y,1)*coef(eq2,x,1),
[x==(coef(eq1,x,1)*coef(eq2,x,0)-coef(eq1,x,0)*coef(eq2,x,1)/dd,
y==(coef(eq1,y,1)*coef(eq2,y,0)-coef(eq1,y,0)*coef(eq2,y,1)/dd] ))